//
//  DPWalletAlipayInfoModel.swift
//  DoctorEPlus
//
//  Created by 王林波 on 2021/3/15.
//

import UIKit

class DPWalletAlipayInfoModel: NSObject {
  
    // 新内容
    var balance: String = "" // 余额
    var cashBalance: String = "" // 可提现余额
    var alipayNickName: String = "" // 支付宝昵称
    var alipayAvatar: String = "" // 支付宝头像
    var alipayUserId: String = "" // 支付宝id
    
    var bindAlipayStatus: Int = 0 // 绑定支付宝状态 0.未绑定 1.已绑定
    var status: Int = 0 // 状态 0正常 1冻结

    
    
    
    func parseDic(_ dic: [String: Any]) {
          
        self.balance = BHJsonTool.decodeStringFromDic(dic: dic, key: "balance")
        self.cashBalance = BHJsonTool.decodeStringFromDic(dic: dic, key: "cashBalance")
        self.alipayNickName = BHJsonTool.decodeStringFromDic(dic: dic, key: "alipayNickName")
        self.alipayAvatar = BHJsonTool.decodeStringFromDic(dic: dic, key: "alipayAvatar")
        self.alipayUserId = BHJsonTool.decodeStringFromDic(dic: dic, key: "alipayUserId")

        self.bindAlipayStatus = BHJsonTool.decodeIntFromDic(dic: dic, key: "bindAlipayStatus")
        self.status = BHJsonTool.decodeIntFromDic(dic: dic, key: "status")
        
        if self.balance.isEmpty == true {
            self.balance = "0.00"
            self.cashBalance = "0.00"
        }
    }
}




class DPWalletAccounyInfoModel: NSObject {
    var accountType: String = ""  // 账户类型1-支付宝2-微信 3-银行卡
    var accountNo: String = "" // 账户号
    var accountName: String = ""
    var accountId: String = ""  // 类型名称

    var accountTypeName: String = ""  // 类型名称
    

    func parseDic(_ dic: [String: Any]) {
        self.accountType = BHJsonTool.decodeStringFromDic(dic: dic, key: "accountType")
        self.accountNo = BHJsonTool.decodeStringFromDic(dic: dic, key: "accountNo")
        self.accountName = BHJsonTool.decodeStringFromDic(dic: dic, key: "accountName")
        self.accountTypeName = BHJsonTool.decodeStringFromDic(dic: dic, key: "accountTypeName")
        self.accountId = BHJsonTool.decodeStringFromDic(dic: dic, key: "accountId")
    }
}
